Trying to make a binned data plot: lots of small numbers; some really big ones.
In [3]:
%pylab inline
from numpy import *
from pylab import *
In [8]:
xdata = range(0, 1000, 1)
In [12]:
figure()
hist(xdata)
show()
In [14]:
# Events are the number of occurrences in each bin
events
Out[14]:
In [15]:
#edges are the bounds of each bin. This is what you want to set for your log data.
edges
Out[15]:
In [16]:
patches
Out[16]:
In [76]:
bins = []
for b in xrange(2, 35):
if 2**b < 10000:
bins.append(2**b)
In [77]:
hist(xdata, bins)
gca().set_xscale("log")
In [ ]: